/*
 Copyright To change this template, choose Tools | Templates
 Copyright and open the template in the editor.
 */

package com.click.app.service.impl;

import com.click.app.dao.PurchaseDetailDao;
import com.click.app.model.Material;
import com.click.app.model.PurchaseDetail;
import com.click.app.service.PurchaseDetailManager;
import java.util.Date;
import java.util.List;



/**
 * @author Joel Chuca Condo
 * @date 04/05/2009
 */
public class PurchaseDetailManagerImpl extends GenericManagerImpl<PurchaseDetail, Long> implements PurchaseDetailManager {

    private PurchaseDetailDao purchaseDetailDao;

    public PurchaseDetailManagerImpl(PurchaseDetailDao purchaseDetailDao){
        super(purchaseDetailDao);
        this.purchaseDetailDao = purchaseDetailDao;
    }

    public List<PurchaseDetail> findByMaterial(Material material) {
        return purchaseDetailDao.findByMaterial(material);
    }

    public List<PurchaseDetail> findByMaterial(Long id) {
        return purchaseDetailDao.findByMaterial(id);
    }

    public List<PurchaseDetail> findByMaterialPeriod(Material material, Date initDate, Date endDate) {
        return purchaseDetailDao.findByMaterialPeriod(material, initDate, endDate);
    }

    public List<PurchaseDetail> findByMaterialPeriod(Long id, Date initDate, Date endDate) {
        return purchaseDetailDao.findByMaterialPeriod(id, initDate, endDate);
    }

    public List<Material> findAllNoPackageDetail(){
        return purchaseDetailDao.findByMaterialPeriod();
    }
    public List<PurchaseDetail> findByMaterialStockNoCero(Long id){
        return purchaseDetailDao.findByMaterialStockNoCero(id);
    }
}
